<template>
    <div>
        <!-- 三级联动全局组件：已经注册为全局组件，不需要在引入了 -->
        <TypeNav />
        <ListContainer />
        <Recommend />
        <Rank />
        <Like />
        <!-- Floor这个组件:自己在组件内部是没有发请求的，数据是父组件给的，所以轮播图可以用mounted()方法-->
        <Floor v-for="(floor,index) in floorList" :key="floor.id" :list="floor"/>
        <Brand />

    </div>
</template>
<script>
    import ListContainer from './ListContainer'
    import Recommend from './Recommend'
    import Rank from './Rank'
    import Like from './Like'
    import Floor from './Floor'
    import Brand from './Brand'
    import {mapState} from 'vuex'
    export default ({
        name: 'Home',
        components: {
            ListContainer,
            Recommend,
            Rank,
            Like,
            Floor,
            Brand
        },
        mounted() {
            this.$store.dispatch("getFloorList");
        },
        computed:{
            ...mapState({
                floorList:(state)=>state.home.floorList
            })
        }

    })
</script>
<style scoped>
</style>
}

&:hover {
.item-list {
display: block;
}
}
}
}
}
}
}
</style>